#include "player.h"


player::player()
{
	x = 0;
	y = 0;
}

player::player(int x, int y){
	this->x = x;
	this->y = y;
}


player::~player()
{
}

void player::move(){
	int moving = 1;
	int ch;
	while (moving){
		ch = _getch();
		switch (ch){
		case KEY_UP:
			if (y > 0){
				y -= 1;
				moving = 0;
			}
			break;
		case KEY_DOWN:
			if (y < 9){
				y += 1;
				moving = 0;
			}
			break;
		case KEY_LEFT:
			if (x > 0){
				x -= 1;
				moving = 0;
			}
			break;
		case KEY_RIGHT:
			if (x < 9){
				x += 1;
				moving = 0;
			}
			break;
		default:
			break;
		}
	}
}